package com.asianrapid.service.impl.sys;

import com.asianrapid.dao.StaffDao;
import com.asianrapid.model.sys.StaffEntity;
import com.asianrapid.service.sys.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "staffServiceImpl")
public class StaffServiceImpl implements StaffService{

    @Autowired
    private StaffDao staffDao;
    @Override
    public StaffEntity getStaffEntityByName(String name) {
        return staffDao.getStaffEntityByName(name);
    }

    @Override
    public List<StaffEntity> staffsList(String name, int pageSize, int start) {
        return staffDao.selectStaff(name,  pageSize,  start);
    }

    @Override
    public Integer staffsSize(String name, int pageSize, int start) {
        return staffDao.staffsSize(name, pageSize, start);
    }

    @Override
    public void insertStaff(StaffEntity staffEntity) {

        staffDao.insertStaff(staffEntity);
    }

    @Override
    public void updateStaff(StaffEntity staffEntity) {
        staffDao.updateStaff(staffEntity);
    }

    @Override
    public void deleteStaffs(List<String> groupId) {
        staffDao.deleteByPrimaryKey(groupId);
    }

}
